package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;

@SpringBootApplication
@EnableAutoConfiguration
@RestController
@RequestMapping("admin/")
@Slf4j
public class DemoApplication {

	/**
	 * 用户首页，用于登录之后给用户看一些信息
	 * 信息可以从数据库中取，这边作为demo，暂时写死
	 * @return
	 */
	@RequestMapping("home")
	String home(HttpServletRequest request) {
		String userName = "Jef";
		int count = 100;
		log.info("home ...........");
		return "欢迎您" + userName + "，这是您的第 " + count + " 次登录";
		//http://localhost:8080/admin/home
	}

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
		System.out.println("(♥◠‿◠)ﾉﾞ  若依启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
		" .-------.       ____     __        \n" +
		" |  _ _   \\      \\   \\   /  /    \n" +
		" | ( ' )  |       \\  _. /  '       \n" +
		" |(_ o _) /        _( )_ .'         \n" +
		" | (_,_).' __  ___(_ o _)'          \n" +
		" |  |\\ \\  |  ||   |(_,_)'         \n" +
		" |  | \\ `'   /|   `-'  /           \n" +
		" |  |  \\    /  \\      /           \n" +
		" ''-'   `'-'    `-..-'              ");
	}

}
